import { createRouter, createWebHistory } from 'vue-router'

const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: [
    {
      path: '',
      redirect: "/login"
    },
    {
      path: '/login',
      name: 'login',
      component: () => import('@/views/Login.vue')
    },
    {
      path: '/401',
      component: () => import('@/views/error/401.vue')
    },
      {
      path: '/404',
      component: () => import('@/views/error/404.vue')
    },
    {
      path: '/',
      component: () => import('@/views/layout/Layout.vue'),
      redirect: 'noredirect',
      children: [
        {
          path: 'userInfo',
          component: () => import('@/views/system/user/userInfo.vue'),
          name: 'userInfo',
          meta: { title: '个人中心', icon: 'user' }
        }
      ]
    }
  ]
})

export default router
